import {
    d as e,
    D as s,
    M as t,
    K as a,
    N as o,
    r as l,
    O as i,
    w as r,
    P as n,
    a as c,
    F as f,
    o as m,
    h as u,
    Q as d,
    i as x,
    R as g,
    j as p,
    l as h,
    t as v,
    s as H,
    k as y,
    S as b,
    U as j,
    V as k
} from "./index.115af62d1729265196717.js";
import {b as $} from "./useForm.9355f9ab1729265196717.js";
import "./index.eec34c841729265196717.js";

const _ = {class: "flex justify-between"}, w = e({
    __name: "Dialog",
    props: {
        modelValue: s.bool.def(!1),
        title: s.string.def("Dialog"),
        fullscreen: s.bool.def(!0),
        maxHeight: s.oneOfType([String, Number]).def("500px")
    },
    setup(e) {
        const s = e, w = t(), z = a((() => {
            const e = ["fullscreen", "title", "maxHeight"], t = {...o(), ...s};
            for (const s in t) -1 !== e.indexOf(s) && delete t[s];
            return t
        })), D = l(!1), O = () => {
            D.value = !c(D)
        }, F = l(i(s.maxHeight) ? `${s.maxHeight}px` : s.maxHeight);
        r((() => D.value), (async e => {
            if (await n(), e) {
                const e = document.documentElement.offsetHeight;
                F.value = e - 55 - 60 - (w.footer ? 63 : 0) + "px"
            } else F.value = i(s.maxHeight) ? `${s.maxHeight}px` : s.maxHeight
        }), {immediate: !0});
        const N = a((() => ({height: c(F)})));
        return (s, t) => {
            const a = f("Icon");
            return m(), u(c($), k(c(z), {
                fullscreen: D.value,
                "destroy-on-close": "",
                "lock-scroll": "",
                draggable: "",
                "close-on-click-modal": !1
            }), d({
                header: x((() => [p("div", _, [g(s.$slots, "title", {}, (() => [h(v(e.title), 1)])), e.fullscreen ? (m(), u(a, {
                    key: 0,
                    class: "mr-18px cursor-pointer is-hover mt-2px z-10",
                    icon: D.value ? "zmdi:fullscreen-exit" : "zmdi:fullscreen",
                    color: "var(--el-color-info)",
                    onClick: O
                }, null, 8, ["icon"])) : H("", !0)])])),
                default: x((() => [y(c(b), {style: j(c(N))}, {
                    default: x((() => [g(s.$slots, "default")])),
                    _: 3
                }, 8, ["style"])])),
                _: 2
            }, [c(w).footer ? {
                name: "footer",
                fn: x((() => [g(s.$slots, "footer")])),
                key: "0"
            } : void 0]), 1040, ["fullscreen"])
        }
    }
});
export {w as _};
